package kassiopeia.commons.log;

import java.io.Serializable;

public class Log implements Serializable {

    private static final long serialVersionUID = 8308017424334868943L;

    private long logId;
    private long timestamp;
    private String agentId;
    private LogLevel level;
    private String message;
    private String className;

    public Log() {}

    public Log(long id) {
    	this.logId = id;
    }

    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public LogLevel getLevel() {
        return level;
    }

    public void setLevel(LogLevel level) {
        this.level = level;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setLogId(long logId) {
        this.logId = logId;
    }

    public long getLogId() {
        return logId;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public int hashCode() {
        return new Long(logId).hashCode();
    }

    @Override
    public boolean equals(Object otherObj) {
        if(!(otherObj instanceof Log)) { return false; }

        Log other = (Log)otherObj;

        return this.logId == other.logId;
    }
}
